<?php
	/*
	 * 珍爱网自动注册脚本
	 * 
	 */
	include_once dirname(dirname(__FILE__))."/include/common.inc.php";
	include_once dirname(dirname(__FILE__))."/zhenai/function.zhenai.php";
	$global_site = "zhenai";
	
	//自动注册珍爱网id
	$new_zhenai_id = 0;
	for($i=0;$i<10;$i++){ //循环10次注册，因为有的ip已经被封了，不是每次都能注册成功
		$new_zhenai_id = registerZhenaiId();
		if ($new_zhenai_id) {
			printlog("success!! -- register zhenai id success, new id : $new_zhenai_id", "register");
			//保存新注册的id
			if(saveZhenaiId($new_zhenai_id)){
				printlog("success!! -- id $new_zhenai_id saved into table success", "register");
				exit;
			}
			else{
				printlog("fail!! -- id $new_zhenai_id saved into table error", "register");
			}
		}
		else{
			printlog("fail!! -- register zhenai id error ... ", "register");
		}
		sleep(30); //25秒后再注册
	}
	

?>